<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>客户资金备注记录 管理</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody" >
<input name="id" id="id" type="hidden"  value="${id}"/>
<div class="Wrapper">
    <div >
        <div class="Title" style="overflow: auto; padding: 0 40px;">
            <h2>备注记录</h2>
        </div>
        <div id='div_cap_fund_rem_log_id' class="recordTask"  style="height: 100%; overflow: auto; padding: 0 10px;">
            
        </div>
         <div class="fieldBox" style="overflow: auto; padding: 0 40px;margin-bottom: 100px">
            <div class="Title" >
            <h2>认款备注</h2>
             </div>
            <div class="field">
                <textarea name="docketRem" id="docketRem"  class="ui-textarea l-textarea"
                          rows="4" cols="60" style="width: 500px ;height:100px"></textarea>
         <div class="BTN">
         <span class="sq-button sq-button-hasicon"  onclick="addFundRemarksLog();"><i class="sqBtnIco_10"></i>保存</span>
        <span class="sq-button sq-button-hasicon"  onclick="cleanFundRemarksLog();"><i class="sqBtnIco_14"></i>取消</span> 
         </div>
          </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        	var fund_Id = $("#id").val();//资金id
        	var parms = {fundId:fund_Id}
        	var _url = '<%=path%>/capital/capFundRemLog/initList.do';
    		AjaxUtils.ajaxGet(_url, parms, function(msg){
    			if(msg.success == 1 && msg.data){
    				 var html = "";
    				
       			  $.each(msg.data, function (n, value) {
       				 var date = new Date(value.crtTm);
       					  html+= "<div class=\"recordBox\"><div class=\"rcTit\">";
       				      html+='创建时间   ：'+DateUtils.formatDate(date, DateUtils.YYYY_MM_DDHHMMSS)+'  &nbsp;&nbsp; 创建人  ：['+value.optUsrNm+'] <br/><br/><span> 内容 ：'+value.remark+'<span/></div>';
       	                  html+="<div class=\"rcBody\"></div>";
       	                  html+="</div>";//rcBody end
       			  });
       			  
       			  if(CollectionUtils.isEmpty(msg.data)){
       				html+="<div class=\"recordBox\"> ";
   				   html+="<div class=\"rcTit\">0000-00-00 00:00:00 [xxxx]xxxxx： 还没有备注信息!</div> <div class=\"rcBody\"></div> </div>";
       			  }
       			  
       			  $("#div_cap_fund_rem_log_id").empty();
       			  $("#div_cap_fund_rem_log_id").html(html);
       			  
       			  SetIframe_height();//重新调整样式

    			 }else{
    				 UIUtils.alertError(msg.info);
    			 }
       	    },true);
        	
    });
    //取消的时候关闭
	function cleanFundRemarksLog() {
		//Remove_navTab();
		frameElement.dialog.hide();
    	
	}
	//添加备注
	function addFundRemarksLog() {
		var parms = {
			id : $("#id").val(),
			content : $("#docketRem").val()
		}
		if(StringUtils.isEmpty($("#docketRem").val())||$("#docketRem").val()==null){
            top.$.ligerDialog.SQalert({content:LogUtils.LOG_CAP_FUND_REM_LOG,SQ_type: "warning"});
            return false;
        }
		var _url = '<%=path%>/capital/capFundRemLog/addCapFundRemarksLog.do';
			AjaxUtils.ajaxPost(_url, parms, function(msg) {
				if (msg.success == 1) {
					UIUtils.alertSuccess(msg.info);
					window.location.reload();//页面自动刷新
					SetIframe_height();//重新调整样式
				} else {
					UIUtils.alertError(msg.info);
				}
			}, true);
		}
</script>

</body>

</html>
